package dev.bong.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import dev.bong.annotation.RoleType;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/4/12 14:07
 * @version: 1.0
 */
// 校验角色编号只能为1-4
public class RoleTypeValidation implements ConstraintValidator<RoleType,Integer> {
    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext context) {

        if(value==1 || value==2 || value==3 || value==4){
            return true;
        }else{
            return false;
        }
    }
}
